<?php

use app\helpers\AppHelper;
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $models */
/* @var $column_class */

if(!isset($column_class) || empty($column_class)){
    $column_class = 'col-4 col-md-6 col-sm-6 col-xs-12';
}
?>
<?php foreach ($models as $model): ?>
    <?php $prefix = explode('-', $model['slug']); $prefix = current($prefix); ?>
    <div class="column py-2 <?= $column_class; ?>">
        <div class="card">
            <div class="card-image">
                <a href="<?= Url::to(['video/detail', 'id' => $model['slug']]); ?>"><img class="img-responsive lazyload" src="" data-src="<?= AppHelper::formatThumb($model['thumbnail']); ?>"></a>
            </div>
            <div class="card-body">
                <h5 class="card-title">
                    <a href="<?= Url::to(['video/detail', 'id' => $model['slug']]); ?>"><?= Html::encode($model['title']); ?></a>
                </h5>
            </div>
        </div>
    </div>

<?php endforeach; ?>